package com.ss.android.c;

import android.os.Message;

import com.bytedance.common.utility.collection.WeakHandler.Callback;
import com.bytedance.common.utility.Logger;

import org.json.JSONObject;

import java.util.Iterator;
import java.util.List;

final class b implements Callback {
    private final com.ss.android.c.a a;

    b(com.ss.android.c.a arg1) {
        this.a = arg1;

    }

    public final void handleMsg(Message message) {
        com.ss.android.c.a v1;
        try {
            v1 = this.a;
            switch (message.what) {
                case 104: {
                    try {
//            label_4:
                        Object v0_1 = message.obj;
                        long v2 = ((JSONObject) v0_1).optLong("i");
                        String v4 = ((JSONObject) v0_1).optString("t");
                        List v1_1 = v1.d;
                        if (v1_1 == null) {
                            return;
                        }

                        Iterator v5 = v1_1.iterator();
                        while (v5.hasNext()) {
                            ((com.ss.android.c.a.b) v5.next()).a(v2, v4, ((JSONObject) v0_1).optJSONObject("p"));
                        }
                    } catch (Exception v0) {
                        if (!Logger.debug()) {
                            return;
                        }
                        Logger.w("CommandDispatcher", "onCommandReceive exception: " + v0);
                    }
                }
            }

            return;
        } catch (Exception v0) {
        }
    }
}

